from flask import Flask
from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///dental_analysis.db'
db = SQLAlchemy(app)

class PatientData(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    district = db.Column(db.String(50), nullable=False)
    age = db.Column(db.Integer, nullable=False)
    gender = db.Column(db.String(10), nullable=False)
    tooth_conditions = db.Column(db.String, nullable=False)

    def __repr__(self):
        return f'<PatientData {self.id}>'

if __name__ == '__main__':
    with app.app_context():
        db.create_all()
        print("Database created successfully.")
